package com.yangtao.springbootfreemarker.task;

import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
/*@EnableScheduling*/
public class SchedulerTask {

	@Scheduled(cron = "* * * * * ?")
	private void process() {
		System.out.println("每秒执行cron");
	}

	@Scheduled(fixedRate=6000)
	public void fixedRate() {
		System.out.println("fixedRate:" + System.currentTimeMillis());
	}
}
